#ifndef SECONDWINDOW_H
#define SECONDWINDOW_H

#include "QtGui/qapplication.h"
#include "QtGui/qtgui"
#include "Agora.h"
#include "createUserWindow.h"


class secondWindow: public QWidget
{
	Q_OBJECT

	public:
		secondWindow(QWidget *parent = NULL);
		void				keyPressEvent(QKeyEvent * eventArg);
		void			SetGetKey(bool val);
		void			SetKeyText(int keyValue, QString &text);
		
		void			reload();
	signals:
		void				reload(int tab);
	private slots:
		void			banUser();
		void			unbanUser();
		void			reloadUserList(int tab);
		void			deleteUser();
		void			createUser();
		void			tempDisplay(QWidget*);
		void			setGetKey();
		void			startMicro();
		void			testlocaly();
		void			saveHostRight();
		void			startSpeakers();
		void			validParam();
		void			validVoiceSendMethod();
		void			setAudioQuality();
		void			selectNotBannedUser(QListWidgetItem *current, QListWidgetItem *previous);
		void			selectBannedUser(QListWidgetItem *current, QListWidgetItem *previous);
		void			selectUser(QListWidgetItem *current, QListWidgetItem *previous);
		int				getAudioInKey_Main();

	private:
		void			initRightsList();
		void			addRights(const char *txt);
		void			setRights(unsigned int row, bool checked);
		QWidget			*_parent;
		QTabWidget		*onglets;
		QWidget			*page1;
		QWidget			*page2;
		QWidget			*page3;
		QWidget			*page4;
		QLabel			*nickLabel;
		QLineEdit		*nickField;
		QLabel			*passLabel;
		QLineEdit		*passField;
		QLabel			*privateLabel;
		QCheckBox		*privateChk;
		QGroupBox		*buttonsBox;
		QPushButton		*local;
		QVBoxLayout		*buttons;
		QPushButton		*micro;
		QPushButton		*speaker;
		QButtonGroup	*Group;
		QVBoxLayout		*frequence;
		QGroupBox		*frequenceBox;
		QRadioButton	*kHz8;
		QRadioButton	*kHz16;
		QRadioButton	*kHz32;
		QGroupBox		*formatBox;
		QRadioButton	*stereo;
		QRadioButton	*mono;
		QVBoxLayout		*format;
		QGroupBox		*encodageBox;
		QSpinBox		*quality;
		QPushButton		*validate;
		QVBoxLayout		*encodage;
		QGroupBox		*bandwidthBox;
		QLabel			*acquisition;
		QLabel			*reception;
		QVBoxLayout		*bandwidth;
		QGridLayout		*grid;
		QListWidget		*listUserNotBanned;
		QListWidget		*listUserBanned;
		QListWidget		*listUserRight;
		QListWidget		*listUserRightRights;
		QPushButton		*saveRights;
		unsigned int	_userIdforRights;
		unsigned int	_userIdforUserNotBanned;
		unsigned int	_userIdforUserBanned;
		bool			_testLocaly;
		bool			_getKey;
		QLabel			*KeyPushValueLabel;
		QRadioButton	*pushbutton;
		QRadioButton	*vadbutton;
		QSlider			*vadtime;
		QSlider			*vadLevel;
		QPushButton		*deleteUserButton;
		QPushButton		*createUserButton;
		CreateUserWindow	*createUserWindow;
		QListWidgetItem		*currentUserItem;
		QPushButton* banUserButton;
		QPushButton* unbanUserButton;
		//bool			_audioInStarted;
		//bool			_audioOutStarted;
};

#endif